YES(O(1),O(n^2)) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Weak Trs: { #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We add following dependency tuples: Strict DPs: { #abs^#(#0()) -> c_1() , #abs^#(#neg(@x)) -> c_2() , #abs^#(#pos(@x)) -> c_3() , #abs^#(#s(@x)) -> c_4() , #less^#(@x, @y) -> c_5(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , insert^#(@x, @l) -> c_6(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_7(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insert#1^#(nil(), @x) -> c_8() , insert#2^#(#false(), @x, @y, @ys) -> c_9() , insert#2^#(#true(), @x, @y, @ys) -> c_10(insert^#(@x, @ys)) , insertD^#(@x, @l) -> c_11(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_12(insertD#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insertD#1^#(nil(), @x) -> c_13() , insertD#2^#(#false(), @x, @y, @ys) -> c_14() , insertD#2^#(#true(), @x, @y, @ys) -> c_15(insertD^#(@x, @ys)) , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_17(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , insertionsort#1^#(nil()) -> c_18() , insertionsortD^#(@l) -> c_19(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_20(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) , insertionsortD#1^#(nil()) -> c_21() } Weak DPs: { #cklt^#(#EQ()) -> c_34() , #cklt^#(#GT()) -> c_35() , #cklt^#(#LT()) -> c_36() , #compare^#(#0(), #0()) -> c_22() , #compare^#(#0(), #neg(@y)) -> c_23() , #compare^#(#0(), #pos(@y)) -> c_24() , #compare^#(#0(), #s(@y)) -> c_25() , #compare^#(#neg(@x), #0()) -> c_26() , #compare^#(#neg(@x), #neg(@y)) -> c_27(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_28() , #compare^#(#pos(@x), #0()) -> c_29() , #compare^#(#pos(@x), #neg(@y)) -> c_30() , #compare^#(#pos(@x), #pos(@y)) -> c_31(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_32() , #compare^#(#s(@x), #s(@y)) -> c_33(#compare^#(@x, @y)) } and mark the set of starting terms. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { #abs^#(#0()) -> c_1() , #abs^#(#neg(@x)) -> c_2() , #abs^#(#pos(@x)) -> c_3() , #abs^#(#s(@x)) -> c_4() , #less^#(@x, @y) -> c_5(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , insert^#(@x, @l) -> c_6(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_7(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insert#1^#(nil(), @x) -> c_8() , insert#2^#(#false(), @x, @y, @ys) -> c_9() , insert#2^#(#true(), @x, @y, @ys) -> c_10(insert^#(@x, @ys)) , insertD^#(@x, @l) -> c_11(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_12(insertD#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insertD#1^#(nil(), @x) -> c_13() , insertD#2^#(#false(), @x, @y, @ys) -> c_14() , insertD#2^#(#true(), @x, @y, @ys) -> c_15(insertD^#(@x, @ys)) , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_17(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , insertionsort#1^#(nil()) -> c_18() , insertionsortD^#(@l) -> c_19(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_20(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) , insertionsortD#1^#(nil()) -> c_21() } Weak DPs: { #cklt^#(#EQ()) -> c_34() , #cklt^#(#GT()) -> c_35() , #cklt^#(#LT()) -> c_36() , #compare^#(#0(), #0()) -> c_22() , #compare^#(#0(), #neg(@y)) -> c_23() , #compare^#(#0(), #pos(@y)) -> c_24() , #compare^#(#0(), #s(@y)) -> c_25() , #compare^#(#neg(@x), #0()) -> c_26() , #compare^#(#neg(@x), #neg(@y)) -> c_27(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_28() , #compare^#(#pos(@x), #0()) -> c_29() , #compare^#(#pos(@x), #neg(@y)) -> c_30() , #compare^#(#pos(@x), #pos(@y)) -> c_31(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_32() , #compare^#(#s(@x), #s(@y)) -> c_33(#compare^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {1,2,3,4,5,8,9,13,14,18,21} by applications of Pre({1,2,3,4,5,8,9,13,14,18,21}) = {6,7,11,12,16,19}. Here rules are labeled as follows: DPs: { 1: #abs^#(#0()) -> c_1() , 2: #abs^#(#neg(@x)) -> c_2() , 3: #abs^#(#pos(@x)) -> c_3() , 4: #abs^#(#s(@x)) -> c_4() , 5: #less^#(@x, @y) -> c_5(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 6: insert^#(@x, @l) -> c_6(insert#1^#(@l, @x)) , 7: insert#1^#(::(@y, @ys), @x) -> c_7(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , 8: insert#1^#(nil(), @x) -> c_8() , 9: insert#2^#(#false(), @x, @y, @ys) -> c_9() , 10: insert#2^#(#true(), @x, @y, @ys) -> c_10(insert^#(@x, @ys)) , 11: insertD^#(@x, @l) -> c_11(insertD#1^#(@l, @x)) , 12: insertD#1^#(::(@y, @ys), @x) -> c_12(insertD#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , 13: insertD#1^#(nil(), @x) -> c_13() , 14: insertD#2^#(#false(), @x, @y, @ys) -> c_14() , 15: insertD#2^#(#true(), @x, @y, @ys) -> c_15(insertD^#(@x, @ys)) , 16: insertionsort^#(@l) -> c_16(insertionsort#1^#(@l)) , 17: insertionsort#1^#(::(@x, @xs)) -> c_17(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , 18: insertionsort#1^#(nil()) -> c_18() , 19: insertionsortD^#(@l) -> c_19(insertionsortD#1^#(@l)) , 20: insertionsortD#1^#(::(@x, @xs)) -> c_20(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) , 21: insertionsortD#1^#(nil()) -> c_21() , 22: #cklt^#(#EQ()) -> c_34() , 23: #cklt^#(#GT()) -> c_35() , 24: #cklt^#(#LT()) -> c_36() , 25: #compare^#(#0(), #0()) -> c_22() , 26: #compare^#(#0(), #neg(@y)) -> c_23() , 27: #compare^#(#0(), #pos(@y)) -> c_24() , 28: #compare^#(#0(), #s(@y)) -> c_25() , 29: #compare^#(#neg(@x), #0()) -> c_26() , 30: #compare^#(#neg(@x), #neg(@y)) -> c_27(#compare^#(@y, @x)) , 31: #compare^#(#neg(@x), #pos(@y)) -> c_28() , 32: #compare^#(#pos(@x), #0()) -> c_29() , 33: #compare^#(#pos(@x), #neg(@y)) -> c_30() , 34: #compare^#(#pos(@x), #pos(@y)) -> c_31(#compare^#(@x, @y)) , 35: #compare^#(#s(@x), #0()) -> c_32() , 36: #compare^#(#s(@x), #s(@y)) -> c_33(#compare^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_6(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_7(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insert#2^#(#true(), @x, @y, @ys) -> c_10(insert^#(@x, @ys)) , insertD^#(@x, @l) -> c_11(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_12(insertD#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insertD#2^#(#true(), @x, @y, @ys) -> c_15(insertD^#(@x, @ys)) , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_17(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , insertionsortD^#(@l) -> c_19(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_20(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#neg(@x)) -> c_2() , #abs^#(#pos(@x)) -> c_3() , #abs^#(#s(@x)) -> c_4() , #less^#(@x, @y) -> c_5(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_34() , #cklt^#(#GT()) -> c_35() , #cklt^#(#LT()) -> c_36() , #compare^#(#0(), #0()) -> c_22() , #compare^#(#0(), #neg(@y)) -> c_23() , #compare^#(#0(), #pos(@y)) -> c_24() , #compare^#(#0(), #s(@y)) -> c_25() , #compare^#(#neg(@x), #0()) -> c_26() , #compare^#(#neg(@x), #neg(@y)) -> c_27(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_28() , #compare^#(#pos(@x), #0()) -> c_29() , #compare^#(#pos(@x), #neg(@y)) -> c_30() , #compare^#(#pos(@x), #pos(@y)) -> c_31(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_32() , #compare^#(#s(@x), #s(@y)) -> c_33(#compare^#(@x, @y)) , insert#1^#(nil(), @x) -> c_8() , insert#2^#(#false(), @x, @y, @ys) -> c_9() , insertD#1^#(nil(), @x) -> c_13() , insertD#2^#(#false(), @x, @y, @ys) -> c_14() , insertionsort#1^#(nil()) -> c_18() , insertionsortD#1^#(nil()) -> c_21() } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { #abs^#(#0()) -> c_1() , #abs^#(#neg(@x)) -> c_2() , #abs^#(#pos(@x)) -> c_3() , #abs^#(#s(@x)) -> c_4() , #less^#(@x, @y) -> c_5(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_34() , #cklt^#(#GT()) -> c_35() , #cklt^#(#LT()) -> c_36() , #compare^#(#0(), #0()) -> c_22() , #compare^#(#0(), #neg(@y)) -> c_23() , #compare^#(#0(), #pos(@y)) -> c_24() , #compare^#(#0(), #s(@y)) -> c_25() , #compare^#(#neg(@x), #0()) -> c_26() , #compare^#(#neg(@x), #neg(@y)) -> c_27(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_28() , #compare^#(#pos(@x), #0()) -> c_29() , #compare^#(#pos(@x), #neg(@y)) -> c_30() , #compare^#(#pos(@x), #pos(@y)) -> c_31(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_32() , #compare^#(#s(@x), #s(@y)) -> c_33(#compare^#(@x, @y)) , insert#1^#(nil(), @x) -> c_8() , insert#2^#(#false(), @x, @y, @ys) -> c_9() , insertD#1^#(nil(), @x) -> c_13() , insertD#2^#(#false(), @x, @y, @ys) -> c_14() , insertionsort#1^#(nil()) -> c_18() , insertionsortD#1^#(nil()) -> c_21() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_6(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_7(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insert#2^#(#true(), @x, @y, @ys) -> c_10(insert^#(@x, @ys)) , insertD^#(@x, @l) -> c_11(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_12(insertD#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insertD#2^#(#true(), @x, @y, @ys) -> c_15(insertD^#(@x, @ys)) , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_17(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , insertionsortD^#(@l) -> c_19(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_20(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) Due to missing edges in the dependency-graph, the right-hand sides of following rules could be simplified: { insert#1^#(::(@y, @ys), @x) -> c_7(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_12(insertD#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We analyse the complexity of following sub-problems (R) and (S). Problem (S) is obtained from the input problem by shifting strict rules from (R) into the weak component: Problem (R): ------------ Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost Problem (S): ------------ Strict DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost Overall, the transformation results in the following sub-problem(s): Generated new problems: ----------------------- R) Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^2)). S) Strict DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^2)). Proofs for generated problems: ------------------------------ R) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We replace rewrite rules by usable rules: Weak Usable Rules: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We use the processor 'matrix interpretation of dimension 2' to orient following rules strictly. DPs: { 3: insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_1) = {1}, Uargs(c_2) = {1}, Uargs(c_3) = {1}, Uargs(c_7) = {1}, Uargs(c_8) = {1, 2} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [1] [0] [#abs](x1) = [0] [0] [#neg](x1) = [1 0] x1 + [1] [0 0] [0] [#pos](x1) = [1 0] x1 + [0] [0 1] [0] [#s](x1) = [1 0] x1 + [0] [0 1] [2] [#less](x1, x2) = [0] [2] [#compare](x1, x2) = [0 0] x1 + [0 0] x2 + [2] [1 0] [1 0] [0] [#cklt](x1) = [0 0] x1 + [0] [1 0] [0] [insert](x1, x2) = [0 0] x1 + [1 0] x2 + [2] [1 0] [1 1] [1] [insert#1](x1, x2) = [1 0] x1 + [0 0] x2 + [2] [1 1] [1 0] [1] [::](x1, x2) = [0 0] x1 + [1 0] x2 + [2] [1 0] [1 1] [1] [insert#2](x1, x2, x3, x4) = [0 2] x1 + [0 0] x2 + [0 0] x3 + [1 0] x4 + [0] [0 2] [1 0] [1 0] [2 1] [0] [nil] = [0] [0] [#false] = [0] [2] [#true] = [0] [2] [insertD](x1, x2) = [0] [0] [insertD#1](x1, x2) = [0] [0] [insertD#2](x1, x2, x3, x4) = [0] [0] [insertionsort](x1) = [1 0] x1 + [0] [1 2] [0] [insertionsort#1](x1) = [1 0] x1 + [0] [1 2] [0] [insertionsortD](x1) = [0] [0] [insertionsortD#1](x1) = [0] [0] [#EQ] = [2] [0] [#GT] = [2] [0] [#LT] = [2] [1] [#abs^#](x1) = [0] [0] [#less^#](x1, x2) = [0] [0] [#cklt^#](x1) = [0] [0] [#compare^#](x1, x2) = [0] [0] [insert^#](x1, x2) = [2 0] x1 + [1 0] x2 + [2] [0 0] [1 0] [1] [insert#1^#](x1, x2) = [1 0] x1 + [2 0] x2 + [1] [0 0] [0 0] [1] [insert#2^#](x1, x2, x3, x4) = [2 1] x1 + [2 0] x2 + [1 0] x4 + [1] [0 0] [0 0] [0 0] [0] [insertD^#](x1, x2) = [0] [0] [insertD#1^#](x1, x2) = [0] [0] [insertD#2^#](x1, x2, x3, x4) = [0] [0] [insertionsort^#](x1) = [0 2] x1 + [2] [0 0] [0] [insertionsort#1^#](x1) = [0 2] x1 + [2] [0 0] [0] [insertionsortD^#](x1) = [0] [0] [insertionsortD#1^#](x1) = [0] [0] [c_1](x1) = [1 0] x1 + [1] [0 0] [0] [c_2](x1) = [1 1] x1 + [0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 0] [0] [c_4](x1) = [0] [0] [c_5](x1) = [0] [0] [c_6](x1) = [0] [0] [c_7](x1) = [1 0] x1 + [0] [0 0] [0] [c_8](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_9](x1) = [0] [0] [c_10](x1, x2) = [0] [0] This order satisfies following ordering constraints [#less(@x, @y)] = [0] [2] >= [0] [2] = [#cklt(#compare(@x, @y))] [#compare(#0(), #0())] = [2] [2] >= [2] [0] = [#EQ()] [#compare(#0(), #neg(@y))] = [0 0] @y + [2] [1 0] [2] >= [2] [0] = [#GT()] [#compare(#0(), #pos(@y))] = [0 0] @y + [2] [1 0] [1] >= [2] [1] = [#LT()] [#compare(#0(), #s(@y))] = [0 0] @y + [2] [1 0] [1] >= [2] [1] = [#LT()] [#compare(#neg(@x), #0())] = [0 0] @x + [2] [1 0] [2] >= [2] [1] = [#LT()] [#compare(#neg(@x), #neg(@y))] = [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [2] >= [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [0] = [#compare(@y, @x)] [#compare(#neg(@x), #pos(@y))] = [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [1] >= [2] [1] = [#LT()] [#compare(#pos(@x), #0())] = [0 0] @x + [2] [1 0] [1] >= [2] [0] = [#GT()] [#compare(#pos(@x), #neg(@y))] = [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [1] >= [2] [0] = [#GT()] [#compare(#pos(@x), #pos(@y))] = [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [0] >= [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [0] = [#compare(@x, @y)] [#compare(#s(@x), #0())] = [0 0] @x + [2] [1 0] [1] >= [2] [0] = [#GT()] [#compare(#s(@x), #s(@y))] = [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [0] >= [0 0] @x + [0 0] @y + [2] [1 0] [1 0] [0] = [#compare(@x, @y)] [#cklt(#EQ())] = [0] [2] >= [0] [2] = [#false()] [#cklt(#GT())] = [0] [2] >= [0] [2] = [#false()] [#cklt(#LT())] = [0] [2] >= [0] [2] = [#true()] [insert(@x, @l)] = [1 0] @l + [0 0] @x + [2] [1 1] [1 0] [1] >= [1 0] @l + [0 0] @x + [2] [1 1] [1 0] [1] = [insert#1(@l, @x)] [insert#1(::(@y, @ys), @x)] = [0 0] @x + [0 0] @y + [1 0] @ys + [4] [1 0] [1 0] [2 1] [4] >= [0 0] @x + [0 0] @y + [1 0] @ys + [4] [1 0] [1 0] [2 1] [4] = [insert#2(#less(@y, @x), @x, @y, @ys)] [insert#1(nil(), @x)] = [0 0] @x + [2] [1 0] [1] >= [0 0] @x + [2] [1 0] [1] = [::(@x, nil())] [insert#2(#false(), @x, @y, @ys)] = [0 0] @x + [0 0] @y + [1 0] @ys + [4] [1 0] [1 0] [2 1] [4] >= [0 0] @x + [0 0] @y + [1 0] @ys + [4] [1 0] [1 0] [2 1] [4] = [::(@x, ::(@y, @ys))] [insert#2(#true(), @x, @y, @ys)] = [0 0] @x + [0 0] @y + [1 0] @ys + [4] [1 0] [1 0] [2 1] [4] >= [0 0] @x + [0 0] @y + [1 0] @ys + [4] [1 0] [1 0] [2 1] [4] = [::(@y, insert(@x, @ys))] [insertionsort(@l)] = [1 0] @l + [0] [1 2] [0] >= [1 0] @l + [0] [1 2] [0] = [insertionsort#1(@l)] [insertionsort#1(::(@x, @xs))] = [0 0] @x + [1 0] @xs + [2] [2 0] [3 2] [4] >= [0 0] @x + [1 0] @xs + [2] [1 0] [2 2] [1] = [insert(@x, insertionsort(@xs))] [insertionsort#1(nil())] = [0] [0] >= [0] [0] = [nil()] [insert^#(@x, @l)] = [1 0] @l + [2 0] @x + [2] [1 0] [0 0] [1] >= [1 0] @l + [2 0] @x + [2] [0 0] [0 0] [0] = [c_1(insert#1^#(@l, @x))] [insert#1^#(::(@y, @ys), @x)] = [2 0] @x + [1 0] @ys + [3] [0 0] [0 0] [1] >= [2 0] @x + [1 0] @ys + [3] [0 0] [0 0] [0] = [c_2(insert#2^#(#less(@y, @x), @x, @y, @ys))] [insert#2^#(#true(), @x, @y, @ys)] = [2 0] @x + [1 0] @ys + [3] [0 0] [0 0] [0] > [2 0] @x + [1 0] @ys + [2] [0 0] [0 0] [0] = [c_3(insert^#(@x, @ys))] [insertionsort^#(@l)] = [0 2] @l + [2] [0 0] [0] >= [0 2] @l + [2] [0 0] [0] = [c_7(insertionsort#1^#(@l))] [insertionsort#1^#(::(@x, @xs))] = [2 0] @x + [2 2] @xs + [4] [0 0] [0 0] [0] >= [2 0] @x + [1 2] @xs + [4] [0 0] [0 0] [0] = [c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))] The strictly oriented rules are moved into the corresponding weak component(s). We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak DPs: { insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) } Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We use the processor 'matrix interpretation of dimension 2' to orient following rules strictly. DPs: { 2: insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , 4: insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_1) = {1}, Uargs(c_2) = {1}, Uargs(c_3) = {1}, Uargs(c_7) = {1}, Uargs(c_8) = {1, 2} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [1] [1] [#abs](x1) = [0] [0] [#neg](x1) = [1 0] x1 + [1] [1 1] [0] [#pos](x1) = [1 0] x1 + [1] [0 1] [0] [#s](x1) = [1 0] x1 + [2] [0 1] [1] [#less](x1, x2) = [1] [0] [#compare](x1, x2) = [0 0] x1 + [0 0] x2 + [0] [1 0] [1 0] [0] [#cklt](x1) = [1 0] x1 + [1] [0 0] [0] [insert](x1, x2) = [0 0] x1 + [1 0] x2 + [1] [2 2] [1 1] [0] [insert#1](x1, x2) = [1 0] x1 + [0 0] x2 + [1] [1 1] [2 2] [0] [::](x1, x2) = [0 0] x1 + [1 0] x2 + [1] [1 1] [1 1] [0] [insert#2](x1, x2, x3, x4) = [0 0] x1 + [0 0] x2 + [0 0] x3 + [1 0] x4 + [2] [1 1] [2 2] [1 1] [2 1] [0] [nil] = [0] [0] [#false] = [1] [0] [#true] = [1] [0] [insertD](x1, x2) = [0] [0] [insertD#1](x1, x2) = [0] [0] [insertD#2](x1, x2, x3, x4) = [0] [0] [insertionsort](x1) = [1 0] x1 + [0] [2 2] [0] [insertionsort#1](x1) = [1 0] x1 + [0] [2 2] [0] [insertionsortD](x1) = [0] [0] [insertionsortD#1](x1) = [0] [0] [#EQ] = [0] [1] [#GT] = [0] [2] [#LT] = [0] [0] [#abs^#](x1) = [0] [0] [#less^#](x1, x2) = [0] [0] [#cklt^#](x1) = [0] [0] [#compare^#](x1, x2) = [0] [0] [insert^#](x1, x2) = [2 0] x2 + [1] [2 0] [1] [insert#1^#](x1, x2) = [2 0] x1 + [1] [0 0] [0] [insert#2^#](x1, x2, x3, x4) = [1 1] x1 + [2 0] x4 + [0] [1 0] [0 0] [0] [insertD^#](x1, x2) = [0] [0] [insertD#1^#](x1, x2) = [0] [0] [insertD#2^#](x1, x2, x3, x4) = [0] [0] [insertionsort^#](x1) = [2 2] x1 + [2] [0 0] [0] [insertionsort#1^#](x1) = [2 2] x1 + [2] [0 0] [0] [insertionsortD^#](x1) = [0] [0] [insertionsortD#1^#](x1) = [0] [0] [c_1](x1) = [1 1] x1 + [0] [0 0] [0] [c_2](x1) = [1 1] x1 + [0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 0] [0] [c_4](x1) = [0] [0] [c_5](x1) = [0] [0] [c_6](x1) = [0] [0] [c_7](x1) = [1 0] x1 + [0] [0 0] [0] [c_8](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_9](x1) = [0] [0] [c_10](x1, x2) = [0] [0] This order satisfies following ordering constraints [#less(@x, @y)] = [1] [0] >= [1] [0] = [#cklt(#compare(@x, @y))] [#compare(#0(), #0())] = [0] [2] >= [0] [1] = [#EQ()] [#compare(#0(), #neg(@y))] = [0 0] @y + [0] [1 0] [2] >= [0] [2] = [#GT()] [#compare(#0(), #pos(@y))] = [0 0] @y + [0] [1 0] [2] >= [0] [0] = [#LT()] [#compare(#0(), #s(@y))] = [0 0] @y + [0] [1 0] [3] >= [0] [0] = [#LT()] [#compare(#neg(@x), #0())] = [0 0] @x + [0] [1 0] [2] >= [0] [0] = [#LT()] [#compare(#neg(@x), #neg(@y))] = [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [2] >= [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [0] = [#compare(@y, @x)] [#compare(#neg(@x), #pos(@y))] = [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [2] >= [0] [0] = [#LT()] [#compare(#pos(@x), #0())] = [0 0] @x + [0] [1 0] [2] >= [0] [2] = [#GT()] [#compare(#pos(@x), #neg(@y))] = [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [2] >= [0] [2] = [#GT()] [#compare(#pos(@x), #pos(@y))] = [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [2] >= [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [0] = [#compare(@x, @y)] [#compare(#s(@x), #0())] = [0 0] @x + [0] [1 0] [3] >= [0] [2] = [#GT()] [#compare(#s(@x), #s(@y))] = [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [4] >= [0 0] @x + [0 0] @y + [0] [1 0] [1 0] [0] = [#compare(@x, @y)] [#cklt(#EQ())] = [1] [0] >= [1] [0] = [#false()] [#cklt(#GT())] = [1] [0] >= [1] [0] = [#false()] [#cklt(#LT())] = [1] [0] >= [1] [0] = [#true()] [insert(@x, @l)] = [1 0] @l + [0 0] @x + [1] [1 1] [2 2] [0] >= [1 0] @l + [0 0] @x + [1] [1 1] [2 2] [0] = [insert#1(@l, @x)] [insert#1(::(@y, @ys), @x)] = [0 0] @x + [0 0] @y + [1 0] @ys + [2] [2 2] [1 1] [2 1] [1] >= [0 0] @x + [0 0] @y + [1 0] @ys + [2] [2 2] [1 1] [2 1] [1] = [insert#2(#less(@y, @x), @x, @y, @ys)] [insert#1(nil(), @x)] = [0 0] @x + [1] [2 2] [0] >= [0 0] @x + [1] [1 1] [0] = [::(@x, nil())] [insert#2(#false(), @x, @y, @ys)] = [0 0] @x + [0 0] @y + [1 0] @ys + [2] [2 2] [1 1] [2 1] [1] >= [0 0] @x + [0 0] @y + [1 0] @ys + [2] [1 1] [1 1] [2 1] [1] = [::(@x, ::(@y, @ys))] [insert#2(#true(), @x, @y, @ys)] = [0 0] @x + [0 0] @y + [1 0] @ys + [2] [2 2] [1 1] [2 1] [1] >= [0 0] @x + [0 0] @y + [1 0] @ys + [2] [2 2] [1 1] [2 1] [1] = [::(@y, insert(@x, @ys))] [insertionsort(@l)] = [1 0] @l + [0] [2 2] [0] >= [1 0] @l + [0] [2 2] [0] = [insertionsort#1(@l)] [insertionsort#1(::(@x, @xs))] = [0 0] @x + [1 0] @xs + [1] [2 2] [4 2] [2] >= [0 0] @x + [1 0] @xs + [1] [2 2] [3 2] [0] = [insert(@x, insertionsort(@xs))] [insertionsort#1(nil())] = [0] [0] >= [0] [0] = [nil()] [insert^#(@x, @l)] = [2 0] @l + [1] [2 0] [1] >= [2 0] @l + [1] [0 0] [0] = [c_1(insert#1^#(@l, @x))] [insert#1^#(::(@y, @ys), @x)] = [2 0] @ys + [3] [0 0] [0] > [2 0] @ys + [2] [0 0] [0] = [c_2(insert#2^#(#less(@y, @x), @x, @y, @ys))] [insert#2^#(#true(), @x, @y, @ys)] = [2 0] @ys + [1] [0 0] [1] >= [2 0] @ys + [1] [0 0] [0] = [c_3(insert^#(@x, @ys))] [insertionsort^#(@l)] = [2 2] @l + [2] [0 0] [0] >= [2 2] @l + [2] [0 0] [0] = [c_7(insertionsort#1^#(@l))] [insertionsort#1^#(::(@x, @xs))] = [2 2] @x + [4 2] @xs + [4] [0 0] [0 0] [0] > [4 2] @xs + [3] [0 0] [0] = [c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))] Consider the set of all dependency pairs DPs: { 1: insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , 2: insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , 3: insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , 4: insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) , 5: insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) } Processor 'matrix interpretation of dimension 2' induces the complexity certificate YES(?,O(n^2)) on application of dependency pairs {2,4}. These cover all (indirect) predecessors of dependency pairs {1,2,3,4,5}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } We apply the transformation 'usablerules' on the sub-problem: Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded S) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak DPs: { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { insert^#(@x, @l) -> c_1(insert#1^#(@l, @x)) , insert#1^#(::(@y, @ys), @x) -> c_2(insert#2^#(#less(@y, @x), @x, @y, @ys)) , insert#2^#(#true(), @x, @y, @ys) -> c_3(insert^#(@x, @ys)) , insertionsort^#(@l) -> c_7(insertionsort#1^#(@l)) , insertionsort#1^#(::(@x, @xs)) -> c_8(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insert(@x, @l) -> insert#1(@l, @x) , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys) , insert#1(nil(), @x) -> ::(@x, nil()) , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys)) , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsort(@l) -> insertionsort#1(@l) , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs)) , insertionsort#1(nil()) -> nil() , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We replace rewrite rules by usable rules: Weak Usable Rules: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We use the processor 'matrix interpretation of dimension 2' to orient following rules strictly. DPs: { 3: insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) } Trs: { insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Sub-proof: ---------- The following argument positions are usable: Uargs(c_4) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_9) = {1}, Uargs(c_10) = {1, 2} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [0] [0] [#abs](x1) = [0] [0] [#neg](x1) = [2] [0] [#pos](x1) = [1 0] x1 + [0] [0 1] [1] [#s](x1) = [1 1] x1 + [2] [0 1] [0] [#less](x1, x2) = [0] [2] [#compare](x1, x2) = [0 0] x1 + [0 0] x2 + [0] [1 0] [1 2] [0] [#cklt](x1) = [0] [1] [insert](x1, x2) = [0] [0] [insert#1](x1, x2) = [0] [0] [::](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 0] [0 1] [1] [insert#2](x1, x2, x3, x4) = [0] [0] [nil] = [2] [2] [#false] = [0] [1] [#true] = [0] [1] [insertD](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 0] [0 1] [1] [insertD#1](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 1] [0 0] [1] [insertD#2](x1, x2, x3, x4) = [0 0] x1 + [1 0] x2 + [1 0] x3 + [1 2] x4 + [1] [2 0] [0 0] [0 0] [0 1] [2] [insertionsort](x1) = [0] [0] [insertionsort#1](x1) = [0] [0] [insertionsortD](x1) = [2 2] x1 + [1] [0 1] [0] [insertionsortD#1](x1) = [2 1] x1 + [1] [0 1] [0] [#EQ] = [0] [0] [#GT] = [0] [0] [#LT] = [1] [1] [#abs^#](x1) = [0] [0] [#less^#](x1, x2) = [0] [0] [#cklt^#](x1) = [0] [0] [#compare^#](x1, x2) = [0] [0] [insert^#](x1, x2) = [0] [0] [insert#1^#](x1, x2) = [0] [0] [insert#2^#](x1, x2, x3, x4) = [0] [0] [insertD^#](x1, x2) = [2 0] x1 + [0 2] x2 + [0] [0 0] [0 0] [1] [insertD#1^#](x1, x2) = [0 2] x1 + [2 0] x2 + [0] [0 0] [0 0] [1] [insertD#2^#](x1, x2, x3, x4) = [1 1] x1 + [2 0] x2 + [0 2] x4 + [0] [0 0] [0 0] [0 0] [0] [insertionsort^#](x1) = [0] [0] [insertionsort#1^#](x1) = [0] [0] [insertionsortD^#](x1) = [2 0] x1 + [1] [0 0] [0] [insertionsortD#1^#](x1) = [2 0] x1 + [1] [0 0] [0] [c_1](x1) = [0] [0] [c_2](x1) = [0] [0] [c_3](x1) = [0] [0] [c_4](x1) = [1 0] x1 + [0] [0 0] [0] [c_5](x1) = [1 1] x1 + [0] [0 0] [0] [c_6](x1) = [1 0] x1 + [0] [0 0] [0] [c_7](x1) = [0] [0] [c_8](x1, x2) = [0] [0] [c_9](x1) = [1 0] x1 + [0] [0 0] [0] [c_10](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] This order satisfies following ordering constraints [#less(@x, @y)] = [0] [2] >= [0] [1] = [#cklt(#compare(@x, @y))] [#cklt(#EQ())] = [0] [1] >= [0] [1] = [#false()] [#cklt(#GT())] = [0] [1] >= [0] [1] = [#false()] [#cklt(#LT())] = [0] [1] >= [0] [1] = [#true()] [insertD(@x, @l)] = [1 1] @l + [1 0] @x + [0] [0 1] [0 0] [1] >= [1 1] @l + [1 0] @x + [0] [0 1] [0 0] [1] = [insertD#1(@l, @x)] [insertD#1(::(@y, @ys), @x)] = [1 0] @x + [1 0] @y + [1 2] @ys + [1] [0 0] [0 0] [0 1] [2] >= [1 0] @x + [1 0] @y + [1 2] @ys + [1] [0 0] [0 0] [0 1] [2] = [insertD#2(#less(@y, @x), @x, @y, @ys)] [insertD#1(nil(), @x)] = [1 0] @x + [4] [0 0] [3] >= [1 0] @x + [4] [0 0] [3] = [::(@x, nil())] [insertD#2(#false(), @x, @y, @ys)] = [1 0] @x + [1 0] @y + [1 2] @ys + [1] [0 0] [0 0] [0 1] [2] >= [1 0] @x + [1 0] @y + [1 2] @ys + [1] [0 0] [0 0] [0 1] [2] = [::(@x, ::(@y, @ys))] [insertD#2(#true(), @x, @y, @ys)] = [1 0] @x + [1 0] @y + [1 2] @ys + [1] [0 0] [0 0] [0 1] [2] >= [1 0] @x + [1 0] @y + [1 2] @ys + [1] [0 0] [0 0] [0 1] [2] = [::(@y, insertD(@x, @ys))] [insertionsortD(@l)] = [2 2] @l + [1] [0 1] [0] >= [2 1] @l + [1] [0 1] [0] = [insertionsortD#1(@l)] [insertionsortD#1(::(@x, @xs))] = [2 0] @x + [2 3] @xs + [2] [0 0] [0 1] [1] > [1 0] @x + [2 3] @xs + [1] [0 0] [0 1] [1] = [insertD(@x, insertionsortD(@xs))] [insertionsortD#1(nil())] = [7] [2] > [2] [2] = [nil()] [insertD^#(@x, @l)] = [0 2] @l + [2 0] @x + [0] [0 0] [0 0] [1] >= [0 2] @l + [2 0] @x + [0] [0 0] [0 0] [0] = [c_4(insertD#1^#(@l, @x))] [insertD#1^#(::(@y, @ys), @x)] = [2 0] @x + [0 2] @ys + [2] [0 0] [0 0] [1] >= [2 0] @x + [0 2] @ys + [2] [0 0] [0 0] [0] = [c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys))] [insertD#2^#(#true(), @x, @y, @ys)] = [2 0] @x + [0 2] @ys + [1] [0 0] [0 0] [0] > [2 0] @x + [0 2] @ys + [0] [0 0] [0 0] [0] = [c_6(insertD^#(@x, @ys))] [insertionsortD^#(@l)] = [2 0] @l + [1] [0 0] [0] >= [2 0] @l + [1] [0 0] [0] = [c_9(insertionsortD#1^#(@l))] [insertionsortD#1^#(::(@x, @xs))] = [2 0] @x + [2 2] @xs + [1] [0 0] [0 0] [0] >= [2 0] @x + [2 2] @xs + [1] [0 0] [0 0] [0] = [c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs))] The strictly oriented rules are moved into the corresponding weak component(s). We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak DPs: { insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) } Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We use the processor 'matrix interpretation of dimension 2' to orient following rules strictly. DPs: { 4: insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) , 5: insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) } Trs: { #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#s(@x), #0()) -> #GT() } Sub-proof: ---------- The following argument positions are usable: Uargs(c_4) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_9) = {1}, Uargs(c_10) = {1, 2} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [2] [0] [#abs](x1) = [0] [0] [#neg](x1) = [1 0] x1 + [2] [1 1] [1] [#pos](x1) = [1 0] x1 + [2] [0 1] [0] [#s](x1) = [1 0] x1 + [2] [0 1] [0] [#less](x1, x2) = [1] [2] [#compare](x1, x2) = [1] [1] [#cklt](x1) = [0 1] x1 + [0] [0 0] [1] [insert](x1, x2) = [0] [0] [insert#1](x1, x2) = [0] [0] [::](x1, x2) = [1 0] x2 + [1] [1 1] [0] [insert#2](x1, x2, x3, x4) = [0] [0] [nil] = [0] [0] [#false] = [1] [0] [#true] = [1] [1] [insertD](x1, x2) = [1 0] x2 + [1] [1 1] [0] [insertD#1](x1, x2) = [1 0] x1 + [1] [1 1] [0] [insertD#2](x1, x2, x3, x4) = [0 0] x1 + [1 0] x4 + [2] [1 0] [2 1] [0] [insertionsort](x1) = [0] [0] [insertionsort#1](x1) = [0] [0] [insertionsortD](x1) = [1 0] x1 + [0] [0 1] [1] [insertionsortD#1](x1) = [1 0] x1 + [0] [0 1] [1] [#EQ] = [0] [1] [#GT] = [0] [1] [#LT] = [1] [1] [#abs^#](x1) = [0] [0] [#less^#](x1, x2) = [0] [0] [#cklt^#](x1) = [0] [0] [#compare^#](x1, x2) = [0] [0] [insert^#](x1, x2) = [0] [0] [insert#1^#](x1, x2) = [0] [0] [insert#2^#](x1, x2, x3, x4) = [0] [0] [insertD^#](x1, x2) = [1 0] x2 + [0] [0 0] [1] [insertD#1^#](x1, x2) = [1 0] x1 + [0] [0 0] [0] [insertD#2^#](x1, x2, x3, x4) = [0 0] x1 + [1 0] x4 + [1] [1 1] [0 0] [2] [insertionsort^#](x1) = [0] [0] [insertionsort#1^#](x1) = [0] [0] [insertionsortD^#](x1) = [2 1] x1 + [2] [0 0] [0] [insertionsortD#1^#](x1) = [2 1] x1 + [2] [0 0] [0] [c_1](x1) = [0] [0] [c_2](x1) = [0] [0] [c_3](x1) = [0] [0] [c_4](x1) = [1 1] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 0] [0] [c_6](x1) = [1 0] x1 + [0] [0 0] [0] [c_7](x1) = [0] [0] [c_8](x1, x2) = [0] [0] [c_9](x1) = [1 0] x1 + [0] [0 0] [0] [c_10](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] This order satisfies following ordering constraints [#less(@x, @y)] = [1] [2] >= [1] [1] = [#cklt(#compare(@x, @y))] [#compare(#0(), #0())] = [1] [1] > [0] [1] = [#EQ()] [#compare(#0(), #neg(@y))] = [1] [1] > [0] [1] = [#GT()] [#compare(#0(), #pos(@y))] = [1] [1] >= [1] [1] = [#LT()] [#compare(#0(), #s(@y))] = [1] [1] >= [1] [1] = [#LT()] [#compare(#neg(@x), #0())] = [1] [1] >= [1] [1] = [#LT()] [#compare(#neg(@x), #neg(@y))] = [1] [1] >= [1] [1] = [#compare(@y, @x)] [#compare(#neg(@x), #pos(@y))] = [1] [1] >= [1] [1] = [#LT()] [#compare(#pos(@x), #0())] = [1] [1] > [0] [1] = [#GT()] [#compare(#pos(@x), #neg(@y))] = [1] [1] > [0] [1] = [#GT()] [#compare(#pos(@x), #pos(@y))] = [1] [1] >= [1] [1] = [#compare(@x, @y)] [#compare(#s(@x), #0())] = [1] [1] > [0] [1] = [#GT()] [#compare(#s(@x), #s(@y))] = [1] [1] >= [1] [1] = [#compare(@x, @y)] [#cklt(#EQ())] = [1] [1] >= [1] [0] = [#false()] [#cklt(#GT())] = [1] [1] >= [1] [0] = [#false()] [#cklt(#LT())] = [1] [1] >= [1] [1] = [#true()] [insertD(@x, @l)] = [1 0] @l + [1] [1 1] [0] >= [1 0] @l + [1] [1 1] [0] = [insertD#1(@l, @x)] [insertD#1(::(@y, @ys), @x)] = [1 0] @ys + [2] [2 1] [1] >= [1 0] @ys + [2] [2 1] [1] = [insertD#2(#less(@y, @x), @x, @y, @ys)] [insertD#1(nil(), @x)] = [1] [0] >= [1] [0] = [::(@x, nil())] [insertD#2(#false(), @x, @y, @ys)] = [1 0] @ys + [2] [2 1] [1] >= [1 0] @ys + [2] [2 1] [1] = [::(@x, ::(@y, @ys))] [insertD#2(#true(), @x, @y, @ys)] = [1 0] @ys + [2] [2 1] [1] >= [1 0] @ys + [2] [2 1] [1] = [::(@y, insertD(@x, @ys))] [insertionsortD(@l)] = [1 0] @l + [0] [0 1] [1] >= [1 0] @l + [0] [0 1] [1] = [insertionsortD#1(@l)] [insertionsortD#1(::(@x, @xs))] = [1 0] @xs + [1] [1 1] [1] >= [1 0] @xs + [1] [1 1] [1] = [insertD(@x, insertionsortD(@xs))] [insertionsortD#1(nil())] = [0] [1] >= [0] [0] = [nil()] [insertD^#(@x, @l)] = [1 0] @l + [0] [0 0] [1] >= [1 0] @l + [0] [0 0] [0] = [c_4(insertD#1^#(@l, @x))] [insertD#1^#(::(@y, @ys), @x)] = [1 0] @ys + [1] [0 0] [0] >= [1 0] @ys + [1] [0 0] [0] = [c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys))] [insertD#2^#(#true(), @x, @y, @ys)] = [1 0] @ys + [1] [0 0] [4] > [1 0] @ys + [0] [0 0] [0] = [c_6(insertD^#(@x, @ys))] [insertionsortD^#(@l)] = [2 1] @l + [2] [0 0] [0] >= [2 1] @l + [2] [0 0] [0] = [c_9(insertionsortD#1^#(@l))] [insertionsortD#1^#(::(@x, @xs))] = [3 1] @xs + [4] [0 0] [0] > [3 1] @xs + [3] [0 0] [0] = [c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs))] Consider the set of all dependency pairs DPs: { 1: insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , 2: insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , 3: insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , 4: insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) , 5: insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) } Processor 'matrix interpretation of dimension 2' induces the complexity certificate YES(?,O(n^2)) on application of dependency pairs {4,5}. These cover all (indirect) predecessors of dependency pairs {1,2,3,4,5}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { insertD^#(@x, @l) -> c_4(insertD#1^#(@l, @x)) , insertD#1^#(::(@y, @ys), @x) -> c_5(insertD#2^#(#less(@y, @x), @x, @y, @ys)) , insertD#2^#(#true(), @x, @y, @ys) -> c_6(insertD^#(@x, @ys)) , insertionsortD^#(@l) -> c_9(insertionsortD#1^#(@l)) , insertionsortD#1^#(::(@x, @xs)) -> c_10(insertD^#(@x, insertionsortD(@xs)), insertionsortD^#(@xs)) } We apply the transformation 'usablerules' on the sub-problem: Weak Trs: { #less(@x, @y) -> #cklt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , insertD(@x, @l) -> insertD#1(@l, @x) , insertD#1(::(@y, @ys), @x) -> insertD#2(#less(@y, @x), @x, @y, @ys) , insertD#1(nil(), @x) -> ::(@x, nil()) , insertD#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys)) , insertD#2(#true(), @x, @y, @ys) -> ::(@y, insertD(@x, @ys)) , insertionsortD(@l) -> insertionsortD#1(@l) , insertionsortD#1(::(@x, @xs)) -> insertD(@x, insertionsortD(@xs)) , insertionsortD#1(nil()) -> nil() } StartTerms: basic terms Strategy: innermost No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Hurray, we answered YES(O(1),O(n^2))